package com.white.service.imp;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.white.bean.UserModel;
import com.white.mapper.UserModelMapper;
import com.white.service.UserModelService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserModelServiceImpl extends ServiceImpl<UserModelMapper, UserModel> implements UserModelService {
    @Autowired
    UserModelMapper userModelMapper;


    @Override
    public void viewsInc(Long userId, Long classifyId) {
        userModelMapper.viewsInc(userId, classifyId);
    }

    @Override
    public UserModel getUserModel(Long userId, Long classifyId) {
        return userModelMapper.getUserModel(userId, classifyId);
    }

    @Override
    public void incViewDuration(Long userId, Long articleId, int seconds) {
        userModelMapper.incViewDuration(userId, articleId, seconds);
    }

    @Override
    public void myCreate(UserModel userModel) {
        userModelMapper.myCreate(userModel);
    }

    @Override
    public List<UserModel> searchById(Long userId) {
        return userModelMapper.searchById(userId);
    }
}
